/// 逻辑运算符
pub fn test_logic() {
    let a = 1;
    let b = 2;

    let c = a & b; // 01 & 10 -> 00
    let d = a | b; // 01 | 10 -> 11
    let e = a ^ b; // 01 | 10 -> 11
    let f = a << b; // 01 << 2 -> 0100 = 4
    let g = a >> b; // 01 >> 2 -> 0
    println!("{}, {}, {}, {}, {}", c, d, e, f, g);
}

/// 强制类型转换
pub fn test_type_cast() {
    let a = 15;
    let b1 = a / 2;
    let b2 = (a as f64) / 2.0;
    println!("15/2={}, 15.0/2.0={}", b1, b2);
}
